package org.lzfto.flink.demo.business.flinkTest.function;

import org.apache.flink.api.common.functions.MapFunction;
import org.lzfto.flink.demo.common.SimpleOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson2.JSON;

/**
*
*@author lzfto
*@创建时间 2025年7月1日 09:43:57
*/
public class StrToOrderMapFunction implements MapFunction<String,SimpleOrder > {
	private static Logger LOGGER = LoggerFactory.getLogger(StrToOrderMapFunction.class);
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public SimpleOrder map(String value) throws Exception {
		LOGGER.info("收到待转换的数据:{}",value);
		SimpleOrder order = JSON.to(SimpleOrder.class, value);
		return order;
	}

}
